return (
<Card key={todo.id} className="mb-3">
…
{!todo.completed &&
<Link to={{
pathname: "/todos/" + todo.id,
state: {
currentTodo: todo
}
}}>
<Button variant="outline-info" className="me-2">
Edit
</Button>
</Link>
}
…
If todo.completed is not true, we render the Edit button. For completed todos, the Edit button will not be displayed
(fig. 3).
Figure 3
Running your App
When you run your app now and log in, a user will be able to complete todos they have posted.